package com.bw.controller;

import com.bw.entity.Zzt;
import com.bw.mapper.ZztMapper;
import org.spring.kun.common.ExcelUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
public class EchartsController {

    @Autowired
    ZztMapper zztMapper;

    @RequestMapping("tuPage.do")
    public String tuPage(){


        return "tu";
    }
    @RequestMapping("zzt.do")
    @ResponseBody
    public List<Zzt> zzt(String status){

        return  zztMapper.zztByParam(status);
    }

    @RequestMapping("excelCount.do")
    public void excel(String status, HttpServletResponse response){

        List<Zzt> list = zztMapper.zztByParam(status);


        ExcelUtils.exportExcel(list,"楼盘数量导出","sheet1",response);
    }
}
